# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from ..ai_service.base import AIRequest
from backend import LOG
from backend.commons import catch_exception


class QualityRequest(AIRequest):
    """
    质量检测
    """

    @catch_exception
    def __call__(self, **kwargs):
        LOG.debug("Running on quality service")
        self.set_wfw_data(**kwargs)
        self.call_wfw()
        self.validate_results()
        self.save_request_done()
